{include file="header.html"}

<div class="page-header">
	<h6>
		订单管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			订单列表
		</small>
		<div style="text-align:right">
			<a href="?app=order&act=export&where={$where}" target="_blank">导出到EXCEL</a>
			{if $admin->id==4 || $admin->id==5}
			<a href="?app=order&act=shop_ranks" target="_blank">门店收入排行</a> 
			{/if}
		</div>
	</h6>
</div><!-- /.page-header -->

<form class="form-inline" action="?" method="get" style="padding-bottom:5px;">
<input type="hidden" name="app" id="app" value="order" />
<input type="hidden" name="act" id="act" value="index" />
<input type="hidden" name="integral_order" id="integral_order" value="{$integral_order}" /> 

关键词：<input type="text" class="input-medium" placeholder="会员名称/地址/电话/单号等" name="keyword" value="{$keyword}" style="width:250px;" /> 
<!-- <select name="pay_method" id="pay_method" class="form-control">
	<option value=""> 支付方式 </option>
	<option value="wxpay" {if $pay_method=="wxpay"}selected{/if}>APP内微信支付</option>
	<option value="wxpay_h5" {if $pay_method=="wxpay_h5"}selected{/if}>服务号内支付</option>
	<option value="alipay" {if $pay_method=="alipay"}selected{/if}>支付宝支付</option>
</select> -->
<select name="status" id="status" class="form-control">
	<option value=""> 订单状态 </option>
	<option value="0" {if $status=="0"}selected{/if}>未支付</option>
	<option value="1" {if $status==1}selected{/if}>已支付</option>
	<option value="2" {if $status==2}selected{/if}>已发货</option>
	<option value="3" {if $status==3}selected{/if}>完成（已收货）</option>
	<option value="4" {if $status=="4"}selected{/if}>已完成（已评价）</option>
	<option value="-1" {if $status==-1}selected{/if}>已取消</option>
	<option value="-2" {if $status==-2}selected{/if}>已退款</option>
	<option value="-3" {if $status==-3}selected{/if}>已退货</option>
</select>


<!-- <select name="shop_id" id="shop_id" class=" form-control "  data-live-search="true" style="line-heght:30px;">
	<option value=""> 门店 </option>
	{foreach from=$shops  item=shop}
	<option value="{$shop->id}" {if $shop->id == $shop_id}selected{/if}>{$shop->name}</option>
	{/foreach}
</select> -->

<!-- <select name="is_jiesuan" id="is_jiesuan" class="form-control">
	<option value=""> 结算状态 </option>
	<option value="0" {if $is_jiesuan=="0"}selected{/if}>未结算</option>
	<option value="1" {if $is_jiesuan==1}selected{/if}>已结算</option>
</select> -->

<button type="submit" class="btn btn-info btn-sm">
	<i class="ace-icon fa fa-search bigger-110"></i>搜索
</button>
<button type="button" class="btn btn-sm" onclick="javascript:self.location='?app=order&act=index'">
	<i class="ace-icon fa fa-undo bigger-110"></i>复位
</button>

</form>

<table id="simple-table" class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>ID</th>
			<th>订单单号</th>
			<th>商品</th>
			<!-- <th>商品名称</th>
			<th>数量</th>
			<th>价格</th> -->
			<!-- <th>门店</th> -->
			<th>下单人</th>
			<th>电话</th>
			<th>服务地址</th>
			<th>{if $integral_order==1}总积分{else}总价/元{/if}</th>
			<!-- <th>佣金支付/元</th> -->
			<!-- <th>优惠劵支付/元</th> -->
			<!-- <th>余额支付/元</th> -->
			<!-- <th>支付方式</th> -->
			<th>状态</th>
			<th>下单时间</th>
			<th>操作</th>
		</tr>
	</thead>

	<tbody>
		{foreach from=$rs item=row name=row}
		<tr>
			<td>{$row.id}</td>
			<td>
			<a href="?app=order&act=edit&order_id={$row.id}">{$row.order_sn}</a></td>
			<td style="min-width:450px;">
				{foreach from=$row.goods item= goods name=good}
				<img src="{if $goods->goods_pic !== ''}{$goods->goods_pic}{else}/images/nopic.png{/if}" style="width:100px;">
				<span>名称：{$goods->goods_name|truncate:10} &nbsp; </span>
				<span>数量：{$goods->quantity} &nbsp; </span>
				<span>价格：{$row.total_price} &nbsp; </span><br/>
				{foreachelse}
				{/foreach}
			</td>

			<!-- <td>
				<a href="?app=shop&act=index&shop_id={$row.shop_id}">{$row.shop_name}</a>
			</td> -->
			<td><a href="?app=member&act=index&member_id={$row.member_id}">{$row.member_name}</a></td>
			<td>{$row.mobile}</td>
			<td>{$row.address}</td>
			<td>{$row.total_price}</td>
			<!-- <td>{$row.used_commission}</td> -->
			<!-- <td>{$row.used_coupon}</td> -->
			<!-- <td>{$row.used_money}</td> -->
			<!-- <td align="center">
				{if $row.pay_method == 'wxpay'}APP内微信支付 
				{else if $row.pay_method == 'wxpay_h5'}服务号内支付 
				{else if $row.pay_method == 'alipay'}支付宝支付
				{else if $row.pay_method == 'integral'}积分兑换{/if}</td> -->
			<td align="center">
				{if $row.status == 0}未支付
				{else if $row.status == 1}已支付
				{else if $row.status == 2}已发货
				{else if $row.status == 3}完成（已收货）
				{else if $row.status == 4}完成（已评价）
				{else if $row.status == -1}取消
				{else if $row.status == -2}退款
				{else if $row.status == -3}退货{/if}</td>
			<td>{$row.add_time|date_format:"%Y-%m-%d"}</td>
			<td>
				<a href="?app=order&act=edit&order_id={$row.id}">
					<button class="btn btn-xs btn-info">
					<i class="ace-icon fa fa-pencil bigger-120"></i>
				</button>
				</a>
				
				<a href="?app=order&act=print_order&order_id={$row.id}" class="">
					<button class="btn btn-xs ">
					<i class="ace-icon fa fa-print bigger-120"></i>
				</button>
				</a>
				
			</td>
		</tr>
		{foreachelse}
		<tr bgcolor="white"><td colspan="13" height="50">暂无记录</td></tr>
		{/foreach}	
		
	</tbody>
</table>
	<div class="mypage" style="text-align:right"> 
			<!--已支付金额：￥{$paid_price}元 &nbsp;    余额支付金额：￥{$yue_paid_price}元 &nbsp; -->  
			共 {$page.num_records} 个记录  {$page.current_page} / {$page.num_pages} 页  {$page.first_page} {$page.prev} {$page.nav} {$page.next} {$page.last_page}
	</div>
{include file="footer.html"}

<script>
$(function(){
	$('#begin_date').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:false,
		showSecond:false,
		format:'yyyy-mm-dd'
	});
	$('#end_date').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:false,
		showSecond:false,
		format:'yyyy-mm-dd'
	});
});
</script>
<script>

	$(window).on('load', function () {

            $('.selectpicker').selectpicker({
                'selectedTexselectpickert': 'cat'
            });

            // $('.selectpicker').selectpicker('hide');
        });

</script>

